package xmlrpc.server;

import org.apache.xmlrpc.XmlRpcException;
import org.apache.xmlrpc.XmlRpcRequest;
import org.apache.xmlrpc.server.RequestProcessorFactoryFactory;

public class ConProcessorFactoryFactory implements RequestProcessorFactoryFactory{
	private final RequestProcessorFactory factory = new ConRequestProcessorFactory();
	private final StringSenderInterface stringSender;
	
	public ConProcessorFactoryFactory(StringSenderInterface stringSender){
		this.stringSender = stringSender;
	}
	@SuppressWarnings("unchecked")
	@Override
	public RequestProcessorFactory getRequestProcessorFactory(Class aClass)
			throws XmlRpcException {
		
		
		return factory;
	}

	private class ConRequestProcessorFactory implements RequestProcessorFactory{

		@Override
		public Object getRequestProcessor(XmlRpcRequest arg0)
				throws XmlRpcException {
			return stringSender;
		}
		
	}
}
